package acciones;

import java.util.Vector;

import persistencia.ArticuloDAO;
import dominio.Articulo;
import dominio.Persona;

import com.opensymphony.xwork2.ActionSupport;

public class ArticulosEditor extends ComprobarSesion {
	private static final long serialVersionUID = 1L;
	private Vector<Articulo> articulos;
	private Persona persona;
	
	public String execute() {
		try {
			persona =  checkSesion("persona");
			if(persona != null){
				this.articulos=ArticuloDAO.getArticulosEstado("NUEVO");
				return SUCCESS;
			}
			else{
				return ERROR;
			}
		}
		catch (Exception e) {
			return ERROR;
		}
	}

	public Vector<Articulo> getArticulos() {
		return articulos;
	}

	public void setArticulos(Vector<Articulo> articulos) {
		this.articulos = articulos;
	}

	public Persona getPersona() {
		return persona;
	}

	public void setPersona(Persona persona) {
		this.persona = persona;
	}
	
	
}
